// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/base/api/EventInfoStatisticControllerApi'

import InfoClass from '@api/base/model/EventInfoStatisticReq'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 信息 —————————————————————————————— //

  async getInfo(param, TIP = '查询信息') {
    const DTO = CORE.grpcDTO(InfoClass, param)
    const resp = await CORE.grpc(TIP, CLIENT, 'eventInfoMonthStatistic', DTO)
    return resp
  },
  transInfo(resp) {
    const dataList = [
      CORE.numStr(resp.currentMonthTotal),
      CORE.numStr(resp.currentMonthHandleRate),
      CORE.numDuringTwo((resp.currentMonthAverageTime / 1000) | 0),
      CORE.numStr(resp.currentMonthSupplyCount),
    ]
    return { dataList }
  },
}
